class PetDog{
    //就地初始化
    public String name = "lele";
    public String color = "red";

    public void eat(){
        System.out.println(this.name + "吃饭");
    }
    //狗的属性
    public void barks(){
        this.eat();
        System.out.println(name + "汪汪");
    }
}

class Student{
    public String name;
    public int age;

    public Student() {
        //调用其他构造方法 -> 只能在构造方法中写
        this("鼠标",9);
        System.out.println("gaga");
    }
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("haha");
    }
    public void show(){
        System.out.println("姓名："+this.name+" 年龄："+this.age);
    }
}
public class day_12_27 {
    public static void main(String[] args) {
        Student s1 = new Student();
        s1.show();
    }




    //静态成员方法
    public static void main1(String[] args) {
        PetDog dog1 = new PetDog();

    }
}
